package homework;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @classname:demo03
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/8 17:31
 * @version: 0.1
 * @since:1.8
 */
public class demo03 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入第一个字符串");
        String str1 = input.next();
        System.out.println("请输入第二个字符串");
        String str2 = input.next();
        System.out.println(isSame(str1, str2));
    }

    private static boolean isSame(String str1, String str2) {
        char[] chars = str1.toCharArray();
        Arrays.sort(chars);
        String newstr2 = new String(chars);
        for (int i = 0; i < str1.length(); i++) {
            if(str2.charAt(i)!=newstr2.charAt(i)){
                return false;
            }
        }
        return true;

    }
}
